/**
 * Copyright (C) 2010 Cloudfarming <info@cloudfarming.nl>
 *
 * Licensed under the Eclipse Public License - v 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.eclipse.org/legal/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * MessageSummaryPanelTestFrame.java
 *
 * Created on Jun 17, 2011, 11:21:23 AM
 */
package nl.cloudfarming.client.messaging.inbox;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.util.Date;
import javax.swing.ImageIcon;
import javax.swing.ScrollPaneConstants;
import nl.cloudfarming.client.messaging.Message;
import org.jdesktop.swingx.ScrollableSizeHint;
import org.openide.util.ImageUtilities;

/**
 *
 * @author monezz
 */
public class MessageSummaryPanelTestFrame extends javax.swing.JFrame {

    
    /** Creates new form MessageSummaryPanelTestFrame */
    public MessageSummaryPanelTestFrame() {
        Message message = new Message();
        message.setTitle("This is the message title");
        Image image = ImageUtilities.loadImage("leaf-icon32.png");
        message.setImage(image);
        message.setMessageText("This is the full text of the message which is a bit longer then the title");
        message.setDateReceived(new Date());
        message.setOrigin("Sender");
        
       
        initComponents();
        messagesPanel1.addMessage(message);
        messagesPanel1.addMessage(message);
        messagesPanel1.addMessage(message);
        messagesPanel1.addMessage(message);
        messagesPanel1.addMessage(message);   
        
        messagesPanel1.setScrollableHeightHint(ScrollableSizeHint.NONE);
        messagesPanel1.setScrollableWidthHint(ScrollableSizeHint.NONE);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        messagesPanel1 = new nl.cloudfarming.client.messaging.inbox.MessagesPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jScrollPane1.setViewportView(messagesPanel1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MessageSummaryPanelTestFrame().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private nl.cloudfarming.client.messaging.inbox.MessagesPanel messagesPanel1;
    // End of variables declaration//GEN-END:variables
}
